package com.charlotte.study.gupao.delegate.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @author junjie.ding
 * @date 2020/3/13
 */
public class Leader implements IEmployee {

    private Map<String, IEmployee> iEmployeeMap = new HashMap<>();

    public Leader() {
        iEmployeeMap.put("敲代码", new ConcreteEmployeeA());
        iEmployeeMap.put("美工", new ConcreteEmployeeB());
    }

    @Override
    public void doTask(String task) {
        if(iEmployeeMap.containsKey(task)){
            iEmployeeMap.get(task).doTask(task);
        }else{
            System.out.println("现在没人能完成这个任务，快联系人力招人！！！");
        }
    }
}
